package Map;

import java.util.Properties;

/**
 * @author 王艺锡
 * @version 1.0
 */
@SuppressWarnings({"all"})
public class Properties_ {
    public static void main(String[] args) {
        //1.Properties继承了Hashtable
        //2.可以通过k-v存放数据，当然键值对中不允许为空
        Properties properties = new Properties();
        properties.put("jack",100);
        properties.put("tom",300);
        properties.put("lihua",90);
        properties.put("lihua",990);//替换
        System.out.println(properties);

        //删remove
        properties.remove("lihua");
        System.out.println(properties);

        //改-替换
        properties.put("tom","66");
        System.out.println(properties);

        //查get   getProperty:如果v类型不为String，则返回null
        System.out.println(properties.get("jack"));
        System.out.println(properties.getProperty("tom"));

    }
}
